package com.xbongbong.pro.domain.dao;

import com.xbongbong.pro.domain.entity.AiAssistantHistoryEntity;
import com.xbongbong.pro.domain.entity.DataWarningHistoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @ClassName DataWarningHistroyDao
 * @Description 数据预警历史记录
 * @Author mengna.Deng
 * @Date 2021/4/15 16:47
 * @Version 1.0
 */
@Repository
@Mapper
public interface DataWarningHistoryDao {
    Integer insert(DataWarningHistoryEntity dataWarningHistoryEntity);

    Integer update(DataWarningHistoryEntity dataWarningHistoryEntity);

    void insertBatch(List<DataWarningHistoryEntity> entityList);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    DataWarningHistoryEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<DataWarningHistoryEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    /**
     * 批量失效
     */
    void invalidBatch(@Param("corpid") String corpid, @Param("idIn") List<Long> idIn);


    List<DataWarningHistoryEntity> queryByDataWarningId(@Param("corpid")String corpid, @Param("dataWarningId")Long dataWarningId,@Param("num")Integer num);

    Integer getTodayExecutedCount(@Param("corpid") String corpid,@Param("zeroTime")Long zeroTime);

    Integer batchPhysicalDelete(@Param("endTime") Long endTime, @Param("corpidIn") List<String> corpidIn);

}
